using System.Collections;

namespace Summation2
{
    public class program2
    {
        public void printPrime(int min,int max,ArrayList arr)
        {
            for (int i = min; i <= max; i++)
            {
                int j = 2;
                for (; j <= Math.Sqrt(i); j++)
                {
                    if (i % j == 0) break;
                }
                if (j > Math.Sqrt(i)) arr.Add(i);
            }
            int p = 1;
            for (int k = 0; k < arr.Count; k++)
            {
                if (p%10!=0)
                {
                    Console.Write(arr[k]+" ");
                }
                else
                {
                    Console.WriteLine(arr[k]);
                }
                p++;
            }
        }
    }

    class test{
        static void Main(string[] args)
        {
            int max, min;
            Console.WriteLine("请输入最小值");
            min = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("请输入最大值");
            max = Convert.ToInt32(Console.ReadLine());
            ArrayList arr = new ArrayList();
            program2 p = new program2();
            p.printPrime(min,max,arr);
        }
    }
}